/**
 * Create by yz_wy_power on 2018/7/6
 */

/**
 * 全局一些状态值
 */
import * as types from '../mutation-types'

const state = {
  breadcrumbInfo: [],
  editorInfo: {
    content: '',
    title: '',
    publishTime: '',
    author: ''
  }
};
const getters = {
  'getBreadcrumbInfo': state => {
    return state['breadcrumbInfo']
  },
  'getEditorInfo': state => {
    return state['editorInfo']
  }
};
const actions = {
  setBreadcrumbInfo({commit}, info) {
    commit(types.setBreadcrumbInfo, info)
  },
  setEditorInfo({commit}, info) {
    commit(types.editorInfo, info)
  }
};
const mutations = {
  [types.setBreadcrumbInfo](state, info) {
    state.breadcrumbInfo = info
  },
  [types.editorInfo](state, info) {
    state.editorInfo = info
  }
};
export default {
  state,
  getters,
  actions,
  mutations
}
